
[dbo].[ComponentRegistryCategory]
CREATE TABLE [dbo].[ComponentRegistryCategory]
(
[ComponentKey] [uniqueidentifier] NOT NULL CONSTRAINT [DF_ComponentRegistryCategory_ComponentKey] DEFAULT (newid()),
[ComponentCategoryKey] [uniqueidentifier] NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ComponentRegistryCategory] ADD CONSTRAINT [PK_ComponentRegistryCategory] PRIMARY KEY CLUSTERED ([ComponentKey], [ComponentCategoryKey]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ComponentRegistryCategory] ADD CONSTRAINT [FK_ComponentRegistryCategory_ComponentCategoryRef] FOREIGN KEY ([ComponentCategoryKey]) REFERENCES [dbo].[ComponentCategoryRef] ([ComponentCategoryKey])
GO
ALTER TABLE [dbo].[ComponentRegistryCategory] ADD CONSTRAINT [FK_ComponentRegistryCategory_ComponentRegistry] FOREIGN KEY ([ComponentKey]) REFERENCES [dbo].[ComponentRegistry] ([ComponentKey])
GO